import Vue from 'vue';
import App from './App';
import router from './router/index';
import {
  post,
  fetch,
  patch,
  put,
  get,
  del,
  downloadPost
} from './utils/http';
import {fileDownload} from './utils/fileUtil';
import 'default-passive-events';
import ElementUi from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'bootstrap/dist/js/bootstrap.bundle.min';
import 'bootstrap/dist/css/bootstrap.css';
import 'font-awesome/css/font-awesome.css';
import Resource from 'vue-resource';
import VueClipboard from 'vue-clipboard2';
import Moment from 'moment';
import axios from 'axios';

Vue.prototype.$http = axios;
Vue.use(Resource);
Vue.use(ElementUi);
VueClipboard.config.autoSetContainer = true;
Vue.use(VueClipboard);
Vue.config.productionTip = false;
// 定义全局变量
Vue.prototype.$post = post;
Vue.prototype.$fetch = fetch;
Vue.prototype.$patch = patch;
Vue.prototype.$put = put;
Vue.prototype.$delete = del;
Vue.prototype.$get = get;
Vue.prototype.$downloadPost = downloadPost;
Vue.prototype.$moment = Moment;
Vue.prototype.$BASE_API = process.env.BASE_API;
Vue.prototype.$fileDownload = fileDownload;
let Base64 = require('js-base64').Base64;
Vue.prototype.$base64 = Base64;

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  render: h => h(App)
});
